package com.insigma.business.qrcode.soldier.dto;


import java.util.LinkedHashMap;
import java.util.Map;


public enum ModelIconEnum implements ValueLabelEnum {

    
    UNEMPLOYMENT("失业登记", "prod/default/20210512/iIJnUQcM02DZnQPuqO.png"),
    
    MERCHANT("优惠", "prod/default/20210826/B8qGvnc5GQrLibDlD8.png"),
    
    HOSPITAL("医疗", "prod/default/20220214/IDEXD55f1aQGNYmd0r.png"),
    
    CELEBRATE("庆祝", "prod/default/20220214/PbKW8NG1Ly0QdJQs6l.png"),

    
    QT("其他", "prod/default/20220214/1wlOzRlbpLAIRhILf6.png"),

    ;

    ModelIconEnum(String value, String label) {
        this.desc = label;
        this.value = value;
        this.label = label;
    }


    
    private String desc;
    private String value;
    private String label;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }
    @Override
    public String getDesc() {
        return desc;
    }


    
    public static ModelIconEnum getByEnumName(final String enumName) {
        for (ModelIconEnum element : values()) {
            if (element.name().equals(enumName)) {
                return element;
            }
        }
        return null;
    }

    public static String getIcon(String enumName) {
        ModelIconEnum byEnumName = getByEnumName(enumName);
        if (byEnumName != null) {
            return byEnumName.getLabel();
        }
        return "";
    }

    
    public static Map<String,String> getName2DescMap(){

        Map<String,String> name2TitleMap = new LinkedHashMap<>();

        for (ModelIconEnum element : values()) {
            name2TitleMap.put(element.name(), element.desc);
        }

        return name2TitleMap;
    }

}
